<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="sql_rt" uri="http://java.sun.com/jstl/sql_rt" %>
<%@ page session="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
    <title></title>
</head>
<body>

<c:if test="${!empty suppliers}">
    <table>
        <tr>
            <th>Id</th>
            <th>Supplier Name</th>
            <th>Contact</th>
            <th>Email</th>
            <th>Description</th>
            <th>Delete</th>
        </tr>

        <c:forEach items="${suppliers}" var="supplier">
            <c:url var="showSupplierUrl" value="/suppliers/show/${supplier.supplier_id}.html" />
            <c:url var="deleteSupplierUrl" value="/suppliers/delete/${supplier.supplier_id}.html" />
            <tr>
                <td><a href="${showSupplierUrl}">${supplier.supplier_id}</a></td>
                <td>${supplier.name}</td>
                <td>${supplier.contact}</td>
                <td>${supplier.email}</td>
                <td>${supplier.description}</td>
                <th><a href="${deleteSupplierUrl}">delete supplier</a></th>
            </tr>
        </c:forEach>
    </table>
</c:if>
<c:if test="${empty suppliers}">
    Currently there are no suppliers
</c:if>


<p><a href="<c:url value="/suppliers/add.html"/>">add new supplier</a></p>

<p><a href="<c:url value="/index.html"/>">home</a></p>
</body>
</html>